<template>
  <div >
  {{ studentid }}
  </div>
</template>

<script>
export default {
  name: 'HomeView',
  data() {
    return {
        studentid: '',
    }
  },
  created() {
    this.getStudentId();
  },
  watch:{
    '$route.params.id': function(newVal) {
      this.getStudentId();
    }
  },
  methods: {
    getStudentId() {
        const studentid = this.$route.params.id;
        console.log(studentid);
        this.studentid = studentid;
    }
  },
}
</script>
